home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 1372.ZIP / PIBCAT.ARC / PIBCAT.GLO < prev    next >
Text File  |  1988-11-07  |  8KB  |  152 lines

  1. (*----------------------------------------------------------------------*)
  2. (*                   GLOBAL VARIABLE DEFINITIONS                        *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. USES                               (* DOS but not IBM PC specific *)
  6.    Dos;
  7.  
  8. TYPE
  9.  
  10.    AnyStr   = STRING[255]  (* Matches any string for parameter passing *);
  11.  
  12.    String2  = STRING[2]    (* Two character string *);
  13.  
  14.    String3  = STRING[3]    (* Three character string *);
  15.  
  16.    String8  = STRING[8]    (* Eight character string *);
  17.  
  18.    FileStr  = STRING[65]   (* File name string *);
  19.  
  20. (*----------------------------------------------------------------------*)
  21. (*                  Error types for library files                       *)
  22. (*----------------------------------------------------------------------*)
  23.  
  24. CONST
  25.    Open_Error    = 1               (* Error when opening file    *);
  26.    Format_Error  = 2               (* Library format bad         *);
  27.    End_Of_File   = 3               (* End of library directory   *);
  28.  
  29. (*----------------------------------------------------------------------*)
  30. (*                    Global program variables                          *)
  31. (*----------------------------------------------------------------------*)
  32.  
  33. CONST
  34.    FF_Char               : CHAR = ^L        (* Form feed character      *);
  35.  
  36. TYPE
  37.    Output_Buffer         = ARRAY[1..8192] OF CHAR;
  38.  
  39. VAR
  40.    Cat_Drive             : CHAR             (* Drive to catalog         *);
  41.    Output_File           : TEXT             (* File to receive output   *);
  42.    Output_File_Name      : AnyStr           (* Output file name         *);
  43.    Output_File_Buffer    : Output_Buffer    (* Output file buffer       *);
  44.    Do_Printer_Format     : BOOLEAN          (* Format for printer       *);
  45.    Left_Margin           : INTEGER          (* Left margin              *);
  46.    Page_Size             : INTEGER          (* Page size for output     *);
  47.    Expand_Libs           : BOOLEAN          (* TRUE to expand libraries *);
  48.    Expand_Libs_In        : BOOLEAN          (* TRUE to expand libraries *)
  49.                                             (* in main catalog list     *);
  50.    Left_Margin_String    : AnyStr           (* Blanks for left margin   *);
  51.    Library_Indent        : INTEGER          (* Indent for libraries     *);
  52.    User_Break            : BOOLEAN          (* TRUE if ^C stops liting  *);
  53.    Find_Spec             : AnyStr           (* File spec for listing    *);
  54.    Entry_Spec            : AnyStr           (* Entry spec for listing   *);
  55.    Entry_Name            : AnyStr           (* Name portion, entry spec *);
  56.    Entry_Ext             : AnyStr           (* Extension, entry spec    *);
  57.    Use_Entry_Spec        : BOOLEAN          (* TRUE to use entry spec   *);
  58.    Total_Files           : LONGINT          (* Total files found        *);
  59.    Total_Space           : LONGINT          (* Total space used         *);
  60.    Total_Entries         : LONGINT          (* Total entries found      *);
  61.    Total_ESpace          : LONGINT          (* Total space used, entries*);
  62.    Total_Dirs            : LONGINT          (* Total dirs scanned       *);
  63.    Page_Number           : INTEGER          (* Current page number      *);
  64.    Lines_Left            : INTEGER          (* Lines left on cur. page  *);
  65.    Help_Only             : BOOLEAN          (* TRUE if doing help only  *);
  66.    Read_Open_Mode        : BYTE             (* Open mode for reads      *);
  67.    Write_Open_Mode       : BYTE             (* Open mode for writes     *);
  68.    Show_Long_File_Names  : BOOLEAN          (* Show long file names     *);
  69.    Use_Share             : BOOLEAN          (* TRUE to use SHARE        *);
  70.    GMT_Difference        : LONGINT          (* # hours local time       *);
  71.                                             (* leads/lags GMT           *)
  72.    Pacific_Difference    : LONGINT          (* # hours Pacific time     *);
  73.                                             (* leads/lags GMT           *)
  74.    Use_Daylight_Savings  : BOOLEAN          (* TRUE to adjust times for *);
  75.                                             (* daylight savings in .DWC *)
  76.                                             
  77. (*----------------------------------------------------------------------*)
  78. (*                  Titles and subtitles for paginated listings         *)
  79. (*----------------------------------------------------------------------*)
  80.  
  81. VAR
  82.    Volume_Title : AnyStr           (* Main title for entire listing *);
  83.    Subdir_Title : AnyStr           (* Current subdirectory title    *);
  84.    File_Title   : AnyStr           (* Current library file if any   *);
  85.  
  86. (*----------------------------------------------------------------------*)
  87. (*                  Saved file names from nested directories            *)
  88. (*----------------------------------------------------------------------*)
  89.  
  90. CONST
  91.    MaxFiles              = 2047             (* Max files in one segment   *);
  92.    MaxSeg                = 360              (* Maximum # segments         *);
  93.    SegShift              = 11               (* 2 ** 11 = 2048             *);
  94.  
  95. TYPE
  96.  
  97.    Short_Dir_Record = RECORD
  98.                          File_Attr : BYTE        (* File attributes *);
  99.                          File_Time : LONGINT     (* Creation time   *);
  100.                          File_Size : LONGINT     (* Size in bytes   *);
  101.                          File_Name : STRING[12]  (* File name       *);
  102.                       END;
  103.  
  104.    File_Stack_Type  = ARRAY[0..MaxFiles] OF Short_Dir_Record;
  105.    File_Stack_Ptr   = ^File_Stack_Type;
  106.  
  107. VAR
  108.                                    (* List of files in current and all  *)
  109.                                    (* previous directories along path   *)
  110.                                    (* back to root directory.           *)
  111.                                    (*                                   *)
  112.                                    (* Since Turbo Pascal doesn't allow  *)
  113.                                    (* arrays to exceed 64K bytes in     *)
  114.                                    (* size, we will use a vector of     *)
  115.                                    (* pointers to simulate a long       *)
  116.                                    (* vector.  The size of each segment *)
  117.                                    (* is chosen to be a power of 2 so   *)
  118.                                    (* that subscripts can be expressed  *)
  119.                                    (* using simple masking operations.  *)
  120.  
  121.    File_Stack  : ARRAY[ 0 .. MaxSeg ] OF File_Stack_Ptr;
  122.  
  123.    Stack_Alloc : INTEGER           (* # of stack entries allocated     *);
  124.  
  125.    File_Count  : WORD              (* # of files currently saved       *);
  126.  
  127. (*----------------------------------------------------------------------*)
  128. (*   Names of the months and days in each month for date conversions    *)
  129. (*----------------------------------------------------------------------*)
  130.  
  131. (* STRUCTURED *) CONST
  132.    Month_Names : ARRAY[1..12] OF STRING[3] =
  133.                  ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  134.                   'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
  135.  
  136. (* STRUCTURED *) CONST
  137.    Days_Per_Month : ARRAY[1..12] OF BYTE
  138.                     = ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
  139.  
  140. (*----------------------------------------------------------------------*)
  141. (*   Starting/ending dates for daylight savings time from 1980 to now   *)
  142. (*----------------------------------------------------------------------*)
  143.  
  144. TYPE
  145.    Daylight_Savings_Record = RECORD
  146.                                 Starting_Time : LONGINT;
  147.                                 Ending_Time   : LONGINT;
  148.                              END;
  149.  
  150. VAR
  151.    Daylight_Savings_Time : ARRAY[1980..2000] OF Daylight_Savings_Record;
  152.